package com.xiguanlezz.cn.common.notify;

import com.xiguanlezz.cn.common.lifecycle.Closeable;
import com.xiguanlezz.cn.common.notify.listener.Subscriber;

/**
 * @Author：习惯了种种
 * @CreateDate：2024/11/28 19:34
 * @Description：事件生产者接口
 */
public interface EventPublisher extends Closeable {

    void init(Class<? extends Event> type, int bufferSize);

    long currentEventSize();

    void addSubscriber(Subscriber subscriber);

    void removeSubscriber(Subscriber subscriber);

    boolean publish(Event event);

    void notifySubscriber(Subscriber subscriber, Event event);

}

